package com.dyz.service.impl;

import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dyz.domain.AdminBank;
import com.dyz.mapper.AdminBankMapper;
import com.dyz.model.Result;
import com.dyz.service.IAdminBankService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 人民币充值卡号管理 服务实现类
 * </p>
 *
 * @author dyz
 * @since 2025-04-30
 */
@Service
public class AdminBankServiceImpl extends ServiceImpl<AdminBankMapper, AdminBank> implements IAdminBankService {
    @Resource
    private AdminBankMapper adminBankMapper;
    @Override
    public Result<?> getList(Page<AdminBank> page, String bankCard, String realName) {
       Page<AdminBank> adminBankPage = adminBankMapper.getList(page, bankCard, realName);
        return Result.success(adminBankPage);
    }

    @Override
    public Result<?> updateStatus(Long id, Integer status) {
       int row= adminBankMapper.updateStatus(id, status);
        return row > 0 ? Result.success("修改状态成功") : Result.fail("修改状态失败");
    }
}
